package com.itbaima.controller;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {

    @RequestMapping(value = "/testParam", method = RequestMethod.GET, params = "code")
    public String testParam() {
        System.out.println("testParam处理请求");
        return "testParam";
    }

    @RequestMapping(value = "/user/{id}/{name}", method = RequestMethod.GET)
    public String findUser(@PathVariable("id") Integer id, @PathVariable("name") String name) {
        System.out.println("findUser");
        System.out.println(id);
        System.out.println(name);
        return "findUser";
    }
}
